import * as Exceljs from 'exceljs';
import { saveWorkBook, generateHeaders } from './saveWorkBook';
const onExportBasicExcel = (
  bookName: string,
  sheetName: string,
  columns: any[],
  dataList: any[],
) => {
  const workbook = new Exceljs.Workbook();
  const worksheet = workbook.addWorksheet(sheetName);
  worksheet.properties.defaultRowHeight = 20;
  worksheet.columns = generateHeaders(columns);
  worksheet.addRows(dataList);
  saveWorkBook(workbook, bookName);
};
export default onExportBasicExcel;
